package org.jvm.rtda.heap;

/**
 * 访问标识
 * 类或类成员的访问标识为多个访问标识的和，类比8421码
 *
 * @author 王思翔
 * @date 2023/2/4
 */
public enum AccessFlags {

    ACC_PUBLIC(0x0001),// class field method
    ACC_PRIVATE(0x0002),//       field method
    ACC_PROTECTED(0x0004),//       field method
    ACC_STATIC(0x0008),//       field method
    ACC_FINAL(0x0010),// class field method
    ACC_SUPER(0x0020),// class
    ACC_SYNCHRONIZED(0x0020),//             method
    ACC_VOLATILE(0x0040),//       field
    ACC_BRIDGE(0x0040),//             method
    ACC_TRANSIENT(0x0080),//       field
    ACC_VARARGS(0x0080),//             method
    ACC_NATIVE(0x0100),//             method
    ACC_INTERFACE(0x0200),// class
    ACC_ABSTRACT(0x0400),// class       method
    ACC_STRICT(0x0800),//             method
    ACC_SYNTHETIC(0x1000),// class field method
    ACC_ANNOTATION(0x2000),// class
    ACC_ENUM(0x4000);// class field


    private final int code;

    AccessFlags(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
